Skip to content

pkcs8: add KeyError enum#2305

Merged
tarcieri merged 1 commit intomasterfrom
pkcs8/add-keyerror
Apr 25, 2026
Merged

pkcs8: add KeyError enum#2305
tarcieri merged 1 commit intomasterfrom
pkcs8/add-keyerror

Conversation

@tarcieri
Copy link
Copy Markdown
Member

Adds an enum to be carried along with pkcs8::Error::KeyMalformed that can give more specific details about what is wrong with the key, e.g. is it being rejected because it's too short or too long.

This has been requested by people who say the existing variant doesn't give enough detail to diagnose the problem.

Adds an enum to be carried along with `pkcs8::Error::KeyMalformed` that
can give more specific details about what is wrong with the key,
e.g. is it being rejected because it's too short or too long.

This has been requested by people who say the existing variant doesn't
give enough detail to diagnose the problem.
@tarcieri tarcieri force-pushed the pkcs8/add-keyerror branch from a19ab42 to 241075e Compare April 25, 2026 15:42
@tarcieri tarcieri merged commit 967d9f1 into master Apr 25, 2026
199 of 217 checks passed
@tarcieri tarcieri deleted the pkcs8/add-keyerror branch April 25, 2026 16:10
tarcieri added a commit to RustCrypto/RSA that referenced this pull request Apr 27, 2026
tarcieri added a commit to RustCrypto/RSA that referenced this pull request Apr 27, 2026
Companion PR to RustCrypto/formats#2305

Bumps `pkcs8` to v0.11.0-rc.12
@tarcieri tarcieri mentioned this pull request Apr 27, 2026
tarcieri added a commit that referenced this pull request Apr 27, 2026
## Added
- Custom error types support to the Decode and DecodeValue traits (#1055)
- PrivateKeyInfoRef / PrivateKeyInfoOwned type aliases (#1483)
- Implement core::error::Error trait for Error (#2302)
- Implement DecodePrivateKey/EncodePrivateKey traits for PrivateKeyInfoOwned (#2306)
- KeyError enum (#2305)
- ctutils feature (#2308)
- getrandom feature (#2311)

## Changed
- Eagerly decode PEM labels for better error messages (#1163)
- Use pbes2::Parameters::generate_recommended (#1430, #2296)
- Make PrivateKeyInfo generic around its backing storage (#1483)
- Bump rand_core to 0.9 (#1658)
- Use 2024 edition; bump MSRV to 1.85 (#1670)
- Bump rand_core to v0.10 (#2198)
- Error::KeyMalformed now wraps an inner KeyError for providing more detail (#2305)
- Use TryCryptoRng instead of CryptoRng (#2309)

## Removed
- subtle feature (#2308)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant